package com.gitee.mars.tourserver.controller;

import com.gitee.mars.tourserver.request.TourRouteRequest;
import com.gitee.mars.tourserver.response.result.R;
import com.gitee.mars.tourserver.service.ITourRouteService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * TourRoute 控制层
 *
 * @Author wq
 * @Date 2021-04-14
 **/
@RestController
@RequestMapping("/tourRoute")
@AllArgsConstructor
public class TourRouteController {

    private final ITourRouteService tourRouteService;


    /**
     * 获取路线
     *
     * @return R
     */
    @GetMapping("/acquire")
    public R acquire() {
        tourRouteService.acquire();
        return R.success();
    }

    /**
     * 列表
     *
     * @param request request
     * @return R
     */
    @PostMapping("/list")
    public R list(@RequestBody TourRouteRequest request) {
        return R.success(tourRouteService.list(request));
    }

}